﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PageTemplate.Master" AutoEventWireup="true" CodeBehind="UserAccount.aspx.cs" Inherits="RMS.Pages.UserAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContent" runat="server">
    <h1>Account Information</h1>
    <hr />
    <br />

    <asp:ListView ID="ListView1" ItemType="RMS.Models.User" SelectMethod="GetUserInformation"
        DataKeyNames="Us_ID" UpdateMethod="UpdateUser"
        EnableViewState="false" runat="server" >

        <LayoutTemplate>
             
            <table class="editTable" runat="server" id="itemPlaceholder"> 
                
           </table>

        </LayoutTemplate>

        <ItemTemplate>
            <table class="editTable">
                <tr>
                    <td>First Name:</td>
                    <td><%# Item.Us_FName %></td>
                </tr>
                 <tr>
                    <td>Middle Initial: </td>
                    <td><%# Item.Us_MInt %></td>
                 </tr>
                <tr>
                    <td>Last Name:</td>
                    <td><%# Item.Us_LName %></td>
                </tr>
                 <tr>
                    <td>Address:</td>
                    <td><%# Item.Us_Address%></td>
                </tr>
                <tr>
                    <td>City:</td>
                    <td><%# Item.Us_City %></td>
                </tr>
                <tr>
                    <td>State: </td>
                    <td><%# Item.Us_State %></td>
                </tr>
                <tr>
                    <td>Zip Code</td>
                    <td><%# Item.Us_Zip %></td>
                </tr>

                <tr>
                    <td>Phone Number:</td>
                    <td><%# Item.Us_Phone %></td>
                </tr>
                <tr>
                    <td>Email Address:</td>
                    <td><b><%# Item.Us_Email %></b></td>
                </tr>
                <tr>
                    <td>
                        <br />
                        <h7>User Options:</h7>
                    </td>
                </tr> 
                <tr>
                    <td></td>
                    <td> 
                        <asp:Button CssClass="myButton" ID="Button1" CommandName="Edit" Text="Edit" runat="server" /> &nbsp;
                        <asp:Button CssClass="myButton" ID="btnChangePass" Text="Change Password" runat="server" OnClick="btnChangePass_Click"/> &nbsp;
                        <asp:Button CssClass="myButton" ID="btnViewVolunteering" Text="Volunteering" runat="server" OnClick="btnViewVolunteering_Click"/>
                    </td>
                    
                </tr>
                   
            </table>
            <hr />            
                    
        </ItemTemplate>

        <EditItemTemplate>
                 <table class="editTable">
                <tr>
                    <td>First Name:</td>
                    <td>
                        <input class="txtbxcomp lettersOnly" name="Us_FName" value="<%# Item.Us_FName %>" />
                        <input type="hidden" name="Us_ID" value="<%# Item.Us_ID %>" />
                    </td>
                </tr>
                <tr>
                    <td>Middle Initial:</td>
                    <td><input class="txtbxcomp lettersOnly" name="Us_MInt" value="<%# Item.Us_MInt %>" /></td> 
                </tr>
                <tr>
                    <td>Last Name:</td>
                    <td><input class="txtbxcomp lettersOnly" name="Us_LName" value="<%# Item.Us_LName %>" /></td>
                </tr>
                 <tr>
                    <td>Address:</td>
                    <td><input class="txtbxcomp" name="Us_Address" value="<%# Item.Us_Address %>" /></td>
                </tr>
                <tr>
                    <td>City:</td>
                    <td><input class="txtbxcomp lettersOnly" name="Us_City" value="<%# Item.Us_City %>" /></td>
                </tr>
                <tr>
                    <td>State:</td>
                    <td><input class="txtbxcomp lettersOnly" name="Us_State" value="<%# Item.Us_State %>" /></td>
                </tr>
                <tr>
                    <td>Zip Code:</td>
                    <td><input class="txtbxcomp numbersOnly" name="Us_Zip" value="<%# Item.Us_Zip %>" /></td>
                </tr>

                <tr>
                    <td>Phone Number:</td>
                    <td><input class="txtbxcomp numbersOnly" name="Us_Phone" value="<%# Item.Us_Phone %>" /></td>
                </tr>
                <tr>
                    <td>Email Address:</td>
                    <td><input class="txtbxcomp" name="Us_Email" value="<%# Item.Us_Email %>" /></td>
                </tr>
                <tr>
                    <td>
                        <br />
                        <h7>User Options:</h7>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td> 
                        <asp:Button CssClass="myButton" ID="Button3" CommandName="Update" Text="Update" runat="server"/>
                        <asp:Button CssClass="myButton" ID="Button4" CommandName="Cancel" Text="Cancel" runat="server"/>
                    </td>
                </tr>
                   
            </table>
            <hr />           
            
        </EditItemTemplate>
             
        <InsertItemTemplate> </InsertItemTemplate>
        
    </asp:ListView>

    
     <asp:ListView ID="ListView2" ItemType="RMS.Models.Retreat" SelectMethod="GetUserReservations"
        DataKeyNames="Ret_Id"  DeleteMethod="DeleteReservation"
        EnableViewState="false" runat="server">

         <LayoutTemplate>
             
            <table class="editTable" runat="server" id="itemPlaceholder"> 
                
           </table>

        </LayoutTemplate>

        <ItemTemplate>
            <br />
            <h8>Current Retreat Registrations:</h8>
            <br />
            <br />
            <table class="editTable">
                <tr>
                    <td>Retreat Title:</td>
                    <td><b><%# Item.Ret_Title %></b></td>
                </tr>
                <tr>
                    <td>Retreat Date:</td>
                    <td><%# getChosenRetreatDate(Item.Ret_ID) %></td>
                </tr>
                <tr>
                    <td>Time:</td>
                    <td><%# Item.Ret_Checkin%></td>
                </tr>
                <tr>
                    <td> 
                        <br />
                        <asp:Button CssClass="myButton" ID="Button2" CommandName="Delete" Text="Cancel Reservation" OnClientClick="return confirm('Are you sure you want to cancel your reservation?');" runat="server" />
                    </td>
                </tr>
            </table>
        </ItemTemplate>

         <EmptyDataTemplate>
             <br />
             <h8>Current Retreat Registrations:</h8>
             <br />
             <br />
             <p class="normalText"><i>You are not currently registered for any retreats.</i></p>
         </EmptyDataTemplate>


        <EditItemTemplate> </EditItemTemplate>
        <InsertItemTemplate> </InsertItemTemplate>

    </asp:ListView>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
    
</asp:Content>
